<?php

    header('Content-Type: text/plain');

/** (lazy) unit test for Cicp_Vector3d **/

include('../autoload.php');

$vector1 = new Cicp_Vector3d;
$vector2 = new Cicp_Vector3d;

$vector1->setValues(3, 6, 2);
$vector2->setValues(5, 12, 4);

echo($vector1);
echo "\n";
echo($vector2);
echo "\n";

echo "Multiplying $vector1 with 4:\n";
echo($vector1->multiply(4));
echo "\n";

echo "Vector1 should still be the same:\n";
echo($vector1);
echo "\n";

echo "Adding vector1 to vector2:\n";
echo($vector1->add($vector2));
echo "\n";

echo "Both vectors should still be the same:\n";
echo($vector1);
echo "\n";
echo($vector2);
echo "\n";

echo "Multiplying v1 and v2 (scalar product):\n";
echo($vector1->multiply($vector2));
echo "\n";

echo "Substracting v1 and v2:\n";
echo($vector1->substract($vector2));
echo "\n";

echo "Substracting 4 from v1:\n";
echo($vector1->substract(4));
echo "\n";

echo "Rotate $v1 by 90 degrees around the x-axis:\n";
echo($vector1->rotateByAxis(0, 90));
echo "\n";

echo "Rotate $v1 by 90 degrees around the y-axis:\n";
echo($vector1->rotateByAxis(1, 90));
echo "\n";

echo "Rotate $v1 by 90 degrees around the z-axis:\n";
echo($vector1->rotateByAxis(2, 90));
echo "\n";

echo "Creating a rgb vector:\n";
$vector3 = new Cicp_Vector3d_RgbColor(232, 122, 33);
echo $vector3;
echo "\n";

echo "Decimal values:\n";
echo $vector3->getDecimalVector();
echo "\n";

echo "Setting blue to 255:\n";
$vector3->b = 255;
echo $vector3;
echo "\n";